<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tlds/fmt.tld" prefix="fmt"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ page contentType = "text/html; charset=UTF-8" %>

<html>
<head>

<c:set var="cssFileName">
	<c:out value="${crudViewMeta.cssFileName}" default="default.css"/>
</c:set>
<link rel="stylesheet" href="<c:url value='/css/${cssFileName}'/>" type="text/css">

<title><c:out value="${crudMeta.title}"/>文本导入数据确认页面</title>
<script type="text/javascript">
function gotoListView()
{
	window.location="<c:url value='/list.do'><c:param name='name' value='${crudMeta.beanName}'/>
	<c:forEach items='${crudMeta.otherWantedParameters}' var='wantedParam'>
    	<c:param name='${wantedParam}' value='${param[wantedParam]}'/>
    </c:forEach></c:url>";
}
</script>
</head>

<body>

<table class="top" align="center">
	<tr><td class="headtitle"><c:out value="${crudMeta.title}"/>导入数据确认-共<c:out value='${nrOfElements}'/>条记录</td></tr>
</table>
<br>

<form name="dataImportConfirmForm" action="<c:url value='/dataImport.do'/>" method="POST"/>
	<input type="hidden" name="name" value="<c:out value='${crudMeta.beanName}'/>"/>
	<input type="hidden" name="nrOfElements" value="<c:out value='${nrOfElements}'/>">
	<c:forEach items="${crudMeta.otherWantedParameters}" var="wantedParam">
		<input type="hidden" name="<c:out value='${wantedParam}'/>" value="<c:out value='${param[wantedParam]}'/>">
	</c:forEach>
	
	<table class="content" width="<c:out value='${crudViewMeta.listTableWidth}'/>">
	
		<!--列头处理-->
		<tr>
		    <!--列名称-->
			<c:forEach items="${importMeta.columnNames}" var="colName">
		  			<td class="headtitle" nowrap>
		  				<c:forEach items="${crudMeta.columnMetas}" var="col">
		  					<c:if test="${colName == col.colName}"><c:out value="${col.title}"/></c:if>
		  				</c:forEach>
		  			</td>
		  	</c:forEach>
		</tr>
		<!--END:列头处理-->
		
		<c:forEach items="${result.records}" var="item" varStatus="s">
			<tr class="body">
				<c:forEach items="${importMeta.columnNames}" var="colName">
					<input type=hidden 
						name="records[<c:out value='${s.index}'/>].mapContent[<c:out value='${colName}'/>]" 
						value="<c:out value='${item.recordCommand.mapContent[colName]}'/>">
			      	<td class="listhead">
			      		<c:out value="${item.recordCommand.mapContent[colName]}"/>
			      	</td>
				</c:forEach>
			</tr>
		</c:forEach>
		
	</table>

	<br>

	<table>
		<tr align="center" valign="center">
			<td align="left" width="50%">
				<input type="submit" name="save" value="保存">
				<input type="button" name="back" value="放弃" onclick="javascript:gotoListView()">
			</td>
			<td width="50%">
			</td>
		</tr>
	</table>
 	
</form>

</body>

</html>